<?php

require_once BASE_PATH.'application/models/basedao'.EXT;

class adsDAO extends moduleDAO {
	
	function __construct()
	{
	    // Call the Model constructor
	    parent::__construct();
           
        }
        
        function getAdsense($stringid)
        {
            $params = $this->getParamsByStringId($stringid);
	    $adsense = (Object)array("adsense"=>"");
            
            if($params){
        
                $publicidad[0] = (empty($params->adsense) and !empty($params->naat)) ? $params->naat : $params->adsense; // cliente
                $publicidad[1] = (isset($params->naat) and !empty($params->naat)) ? $params->naat : $params->adsense; // naat


                $cual = rand(0,1);

                $adsense = (Object)array("adsense"=>$publicidad[$cual]);
            }
            
	    return $adsense;
        }
        
        
}
?>